package cn.com.jit.controller;

import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import cn.com.jit.po.User;

@Controller
public class MyController {

	@RequestMapping("login.do")
	public String login(User user, HttpSession session){
		
		if(user.getUsername().equalsIgnoreCase("admin") && user.getPassword().equals("123")){
			session.setAttribute("user", user);
			return "index.jsp";
		}
		
		return "login.jsp";
	}
	
	@RequestMapping("add")
	public String test(){
		System.out.println("add");
		return "login.jsp";
		
	}
	
}
